// import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import web from './views/web/index.vue'

/* import the fontawesome core */
import { library } from '@fortawesome/fontawesome-svg-core'

/* import font awesome icon component */
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

/* import specific icons */
import { faUserSecret,faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons'
// import { faUser } from '@fortawesome/free-regular-svg-icons'
// import { fa42Group} from '@fortawesome/free-brands-svg-icons'

/* add icons to the library */
library.add(faUserSecret,faMagnifyingGlass)

//走马灯
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';

const app = createApp(web)
// // 设置允许跨域的中间件
// app.all('*', (req, res, next) => {
//     res.header('Access-Control-Allow-Origin', '*');
//     res.header('Access-Control-Allow-Methods', 'GET,POST,PUT,DELETE,OPTIONS');
//     res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
//     if (req.method === 'OPTIONS') {
//       res.sendStatus(200); // 让OPTIONS请求快速结束
//     } else {
//       next(); // 处理其他请求
//     }
//   });
app.use(createPinia())
app.use(router)
app.use(Antd)
app.component('font-awesome-icon', FontAwesomeIcon)
app.mount('#app')
